# from PIL import Image
# import os

# path = "./Pixs"# 原始路径
# save_path = './Pixs'# 保存路径
# all_images = os.listdir(path)

# for image in all_images:
#     if image != ".DS_Store":
#         image_path = os.path.join(path, image)
#         img = Image.open(image_path)  # 打开图片
#         print(img.format, img.size, img.mode)#打印出原图格式
#         img = img.convert("RGB")  # 4通道转化为rgb三通道
#         img.save(save_path + image)


from PIL import Image
def produceImage(file_in, width, height, file_out):
    image = Image.open(file_in)
    resized_image = image.resize((width, height), Image.ANTIALIAS)
    resized_image.save(file_out)
 
if __name__ == '__main__':
    file_in = 'Toys/GenerativeArt/Pixs/6.png'
    width = 60
    height = 60
    file_out = 'Toys/GenerativeArt/Pixs/6.png'
    produceImage(file_in, width, height, file_out)
